import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Manage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'manage',
    component: () => import('../views/Manage.vue'),
    redirect:"/login",
    children:[
      { path: 'home', name: 'Home', component: () => import('../views/Home.vue')},
      { path: 'user', name: 'User', component: () => import('../views/User.vue')},
      { path: 'other', name: 'Other', component: () => import('../views/Other.vue')},
      { path: 'help', name: 'Help', component: () => import('../views/Help.vue')},
      { path: 'person', name: 'Person', component: () => import('../views/Person.vue')},
      { path: 'studentclasses', name: 'StudentClasses', component: () => import('../views/StudentClasses.vue')},
	  { path: 'createClass', name: 'createClass', component: () => import('../views/CreateClass.vue')},
      { path: 'fileupload', name: 'FileUpload', component: () => import('../views/FileUpload.vue')},
      { path: 'OtherFiles', name: 'OtherFiles', component: () => import('../views/OtherFiles.vue')},
      { path: 'FileManagement', name: 'FileManagement', component: () => import('../views/FileManagement.vue')},
	  { path: 'TeacherFileManagement', name: 'TeacherFileManagement', component: () => import('../views/TeacherFileManagement.vue')},
    ]
  },

  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component:() => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component:() => import('../views/Register')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
